<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>

    <style>
        .rating {
            position: relative;
            background: url(img/rating.png) repeat-x;
            width: 240px;
            height: 48px;
            margin: 100px auto;
        }

        .rating-item {
            position: absolute;
            z-index: 3;
            height: 48px;
            width: 48px;
            top: 0;
        }

        .rating-item-1 {
            left: 0px;
        }

        .rating-item-2 {
            left: 48px;
        }

        .rating-item-3 {
            left: 96px;
        }

        .rating-item-4 {
            left: 144px;
        }

        .rating-item-5 {
            left: 192px;
        }

        .rating-item:hover {
            position: absolute;
            z-index: 2;
            height: 48px;
            top: 0;
            left: 0;
            background: url(img/rating.png) repeat-x 0 -94px;
        }

        .rating-item-1:hover {
            width: 48px;
        }

        .rating-item-2:hover {
            width: 96px;
        }

        .rating-item-3:hover {
            width: 144px;
        }

        .rating-item-4:hover {
            width: 192px;            
        }

        .rating-item-5:hover {
            width: 240px;            
        }
    </style>
</head>

<body>
    <div class="rating">
        <a href="javascript:;" class="rating-item rating-item-1"></a>
        <a href="javascript:;" class="rating-item rating-item-2"></a>
        <a href="javascript:;" class="rating-item rating-item-3"></a>
        <a href="javascript:;" class="rating-item rating-item-4"></a>
        <a href="javascript:;" class="rating-item rating-item-5"></a>
    </div>
</body>

</html>